package com.property.management.service.impl;

import java.util.List;
import com.property.common.utils.DateUtils;
import com.property.management.mapper.CourtInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.property.management.mapper.RepairInfoMapper;
import com.property.management.domain.RepairInfo;
import com.property.management.service.IRepairInfoService;
import com.property.common.core.text.Convert;

/**
 * 报修信息Service业务层处理
 * 
 * @author property
 * @date 2021-05-08
 */
@Service
public class RepairInfoServiceImpl implements IRepairInfoService 
{
    @Autowired
    private RepairInfoMapper repairInfoMapper;
    @Autowired
    private CourtInfoMapper courtInfoMapper;
    /**
     * 查询报修信息
     * 
     * @param id 报修信息ID
     * @return 报修信息
     */
    @Override
    public RepairInfo selectRepairInfoById(Integer id)
    {
        return repairInfoMapper.selectRepairInfoById(id);
    }

    /**
     * 查询报修信息列表
     * 
     * @param repairInfo 报修信息
     * @return 报修信息
     */
    @Override
    public List<RepairInfo> selectRepairInfoList(RepairInfo repairInfo)
    {
        return repairInfoMapper.selectRepairInfoList(repairInfo);
    }

    /**
     * 新增报修信息
     * 
     * @param repairInfo 报修信息
     * @return 结果
     */
    @Override
    public int insertRepairInfo(RepairInfo repairInfo)
    {
        repairInfo.setCreateTime(DateUtils.getNowDate());
        return repairInfoMapper.insertRepairInfo(repairInfo);
    }

    /**
     * 修改报修信息
     * 
     * @param repairInfo 报修信息
     * @return 结果
     */
    @Override
    public int updateRepairInfo(RepairInfo repairInfo)
    {
        repairInfo.setUpdateTime(DateUtils.getNowDate());
        return repairInfoMapper.updateRepairInfo(repairInfo);
    }

    /**
     * 删除报修信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteRepairInfoByIds(String ids)
    {
        return repairInfoMapper.deleteRepairInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除报修信息信息
     * 
     * @param id 报修信息ID
     * @return 结果
     */
    @Override
    public int deleteRepairInfoById(Integer id)
    {
        return repairInfoMapper.deleteRepairInfoById(id);
    }
}
